]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
ripples: Allow to specify whether the ripple is required
authorAlessandro Bono <alessandro.bono369@gmail.com>
Fri, 20 Oct 2023 20:00:55 +0000 (22:00 +0200)
committerMarge Bot <marge-bot@gnome.org>
Fri, 6 Sep 2024 13:01:39 +0000 (13:01 +0000)
The ripples are used both for the "Hot Corner" animation and for the
"Locate Pointer" animation. The latter one is an accessibility feature
and should always work, even when animations are disabled. Take this
into account.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2986>

js/ui/ripples.js

index 6785e5c219b85ff3e7999990bf6f28213a138e93..21f5cea21d56cc0b704e51991e3af8e75aad992a 100644 (file)
@@ -3,12 +3,13 @@ import St from 'gi://St';
 
 // Shamelessly copied from the layout "hotcorner" ripples implementation
 export class Ripples {
-    constructor(px, py, styleClass) {
+    constructor(px, py, styleClass, animationRequired = false) {
         this._x = 0;
         this._y = 0;
 
         this._px = px;
         this._py = py;
+        this._animationRequired = animationRequired;
 
         this._ripple1 = new St.BoxLayout({
             style_class: styleClass,
@@ -58,11 +59,13 @@ export class Ripples {
         ripple.opacity = 255 * Math.sqrt(startOpacity);
         ripple.scale_x = ripple.scale_y = startScale;
         ripple.set_translation(-this._px * ripple.width, -this._py * ripple.height, 0.0);
+        const animationRequired = this._animationRequired;
 
         ripple.ease({
             opacity: 0,
             delay,
             duration,
+            animationRequired,
             mode: Clutter.AnimationMode.EASE_IN_QUAD,
         });
         ripple.ease({
@@ -70,6 +73,7 @@ export class Ripples {
             scale_y: finalScale,
             delay,
             duration,
+            animationRequired,
             mode: Clutter.AnimationMode.LINEAR,
             onComplete: () => (ripple.visible = false),
         });